<%--
 *  File:    ComboCodeSegSeqEdit.jsp
 *  @Author: Langerwang
 *  Date:    2002/1/8
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.ComboCodeSegSeqEdit");
  String strTableName = "ovcombocode";
  String strModuleName = "SPM";
  String privilegeCode = "Z0607,Z0614";
%>
<%
  //get userinfo
  HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");

%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ComboCodeSegSeqEdit</title>
<%
  if(request.getParameter("segmentid") != null)
  {
%>
<PageFlow:CheckPageFlow pageName="combocodesegseqedit"/>
<%
  }
  HashMap segseqInfo = (HashMap)pageContext.getAttribute("segseqinfo");
  if(segseqInfo == null)
    segseqInfo = new HashMap();
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript">
<%
  if(request.getParameter("segmentid") == null)
  {
%>
   opener.closeChild();
<%}%>
function clickCy()
{
  if(frm.cych.checked)
    frm.cycle.value = "Y";
  else
    frm.cycle.value = "N";
  return;
}
function page_done()
{
  if(!checkNull(document.frm)) return;
  if(!isNumber(document.frm.startvalue.value))
  {
    alert("<%= message.getMessageDesc("VALUE_MUST_BE_INT", label.getLabelName("L_BeginValue",false)) %>");
    return false;
  }
  if(!isNumber(document.frm.maxvalue.value))
  {
    alert("<%= message.getMessageDesc("VALUE_MUST_BE_INT", label.getLabelName("L_EndValue",false)) %>");
    return false;
  }
  if(!isNumber(document.frm.increments.value))
  {
    alert("<%= message.getMessageDesc("VALUE_MUST_BE_INT", label.getLabelName("L_Increment",false)) %>");
    return false;
  }
  if(Number(document.frm.maxvalue.value) - Number(document.frm.startvalue.value) < Number(document.frm.increments.value))
  {
    alert(replaceString("<%= message.getMessageDesc("VALUE_NOT_LESSTHAN",label.getLabelName("L_EndValue",false)) %>","%s","",Number(document.frm.increments.value) + Number(document.frm.startvalue.value)));
    return false;
  }
  checkNumber(document.frm);
  emptyToNull(document.frm);
  frm.actionname.value = "done";
  isRunning = true;
  frm.submit();
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <form name="frm" method="post" action="../../Dispatcher">
   <input type="hidden" name="pagename" value="combocodesegseqedit">
	 <input type="hidden" name="actionname">

	 <input type="hidden" name="segmentid" value="<%=JspHelper.filterNull( request.getParameter("segmentid") )%>">
	 <oval:hidden name="segseqinfo" property="sequenceid"/>
  <tr>
    <td><img src="../../images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> <%= label.getLabelName("L_SequenceSetting") %><%= label.getLabelName("L_Colon") %></td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        <tr>
          <td class="need" width="80"><%= label.getLabelName("L_SequenceType") %><%= label.getLabelName("L_Colon") %></td>
          <td>
             <oval:select optionsName="allseqtype" optionValueKey="sequencetype" optionInnerTextKey="sequencetypename" name="segseqinfo" property="sequencetype"/>
          </td>
          <td class="td-text" ><%= label.getLabelName("L_IsLoop") %><%= label.getLabelName("L_Colon") %></td>
          <td>
            <input type="checkbox" name="cych" onclick="javascript:clickCy();" value="checkbox" <%=JspHelper.filterNull( (segseqInfo.get("cycle")!=null && segseqInfo.get("cycle").toString().equalsIgnoreCase("Y"))?"Checked":"" )%> class="normalradio">
            <oval:hidden name="segseqinfo" property="cycle"/>
          </td>
        </tr>
        <%String ss = message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_BeginValue",false));%>
        <tr>
          <td class="need" ><%= label.getLabelName("L_BeginValue") %><%= label.getLabelName("L_Colon") %></td>
          <td>
            <input type="text" name="startvalue" size="20" isnull="N" label="<%=JspHelper.filterNull( ss )%>" datatype="number" dataformat="<%=JspHelper.filterNull( session.getAttribute("qtyformat") )%>" value="<oval:write name="segseqinfo" property="startvalue"/>">
          </td>
        <%ss = message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_EndValue",false));%>
        <td class="need"><%= label.getLabelName("L_EndValue") %><%= label.getLabelName("L_Colon") %></td>
          <td>
            <input type="text" name="maxvalue" size="20" isnull="N" label="<%=JspHelper.filterNull( ss )%>" datatype="number" dataformat="<%=JspHelper.filterNull( session.getAttribute("qtyformat") )%>" value="<oval:write name="segseqinfo" property="maxvalue"/>">
          </td>
        </tr>
        <%ss = message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_Increment",false));%>        <tr>
          <td class="need"><%= label.getLabelName("L_Increment") %><%= label.getLabelName("L_Colon") %></td>
          <td colspan="3">
            <input type="text" name="increments" size="20" isnull="N" label="<%=JspHelper.filterNull( ss )%>" datatype="number" dataformat="<%=JspHelper.filterNull( session.getAttribute("qtyformat") )%>" value="<oval:write name="segseqinfo" property="increments"/>">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="summary_top"></td>
  </tr>
  <tr>
    <td class="td_center">    
    <a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a>
    <a onclick="window.close()"><custom:button type="1" label="L_Close" imgsrc="close.gif" border="0" style="width:60"/></a>
    </td>
  </tr>
</form>
</table>
<script>
  checkNumber(document.frm);
</script>
</body>
</html>


